/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Home.java
 *
 * Created on Aug 6, 2010, 9:03:17 PM
 */
package Gui;

import BusinessLogic.BackGroundUtility;
import BusinessLogic.OpenConnection;
import DTO.Manager;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import javax.swing.*;

/**
 *
 * @author SONY
 */
public class Home extends javax.swing.JFrame {

    private int type = -1;
    private Manager manager;
    private final ImagePanel pnExpo;
    private final ImagePanel pnExhibitor;
    private final ImagePanel pnBooth;
    private final ImagePanel pnReport;
    private JLabel lblExhibitor, lblBooth, lblExpo, lblReport;
    private JPanel pnCrossExh, pnCrossEx, pnCrossBo, pnCrossRe;
    private String imgEnter = "image/abcd.png";
    private String imgPress = "image/Press.png";
    private String imgDef = "image/abc.PNG";
    private Font font = new Font("Tahoma", Font.BOLD, 15);
    private ImagePanel pnBackground;

    /** Creates new form Home */
    public Home() {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        initComponents();
        //Open connect to database
        openConnection();
        //Read name of Expo
        readNameExpo();
        //setlocation for application
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension dim = toolkit.getScreenSize();
        Dimension dimApp = getSize();
        int pointX = (dim.width - dimApp.width) / 2;
        int pointY = (dim.height - dimApp.height) / 2 - 10;
        setLocation(pointX, pointY);

        //Set icon for app
        setIconImage(new ImageIcon("image/home-icon.png").getImage());

        //create cross panel
        pnCrossBo = new JPanel();
        pnCrossEx = new JPanel();
        pnCrossExh = new JPanel();
        pnCrossRe = new JPanel();

        Panel.add(pnCrossBo);
        Panel.add(pnCrossEx);
        Panel.add(pnCrossExh);
        Panel.add(pnCrossRe);

        pnCrossEx.setBounds(200, 0, 20, 100);
        pnCrossExh.setBounds(200, 105, 20, 100);
        pnCrossBo.setBounds(200, 210, 20, 100);
        pnCrossRe.setBounds(200, 315, 20, 100);

        pnCrossEx.setOpaque(false);
        pnCrossExh.setOpaque(false);
        pnCrossBo.setOpaque(false);
        pnCrossRe.setOpaque(false);
        //set background
        pnBackground = new ImagePanel(BackGroundUtility.getImage());
        getContentPane().add(pnBackground);
        //create minimize button
        final ImagePanel pnMinimize = new ImagePanel("image/Minimize.png");
        Background.add(pnMinimize);
        pnMinimize.setBounds(760, 5, 24, 24);
        pnMinimize.addMouseListener(new MouseAdapter() {

            @Override
            public void mousePressed(MouseEvent e) {
                setState(JFrame.ICONIFIED);
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                pnMinimize.setOpaque(false);
                pnMinimize.setImage("image/Minimize_enter.png");
            }

            @Override
            public void mouseExited(MouseEvent e) {
                pnMinimize.setOpaque(false);
                pnMinimize.setImage("image/Minimize.png");
            }
        });
        //create close button
        final ImagePanel pnClose = new ImagePanel("image/Close.png");
        Background.add(pnClose);
        pnClose.setBounds(790, 5, 24, 24);
        pnClose.addMouseListener(new MouseAdapter() {

            @Override
            public void mousePressed(MouseEvent e) {
                setVisible(false);
                dispose();
                System.exit(0);
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                pnClose.setOpaque(false);
                pnClose.setImage("image/Close_enter.png");
            }

            @Override
            public void mouseExited(MouseEvent e) {
                pnClose.setOpaque(false);
                pnClose.setImage("image/Close.png");
            }
        });

        //1
        pnExpo = new ImagePanel(imgDef);
        pnExpo.setBounds(0, 0, 200, 100);
        pnExpo.setLayout(null);

        pnExpo.setOpaque(true);
        PanelLeft.add(pnExpo);
        lblExpo = new JLabel("  Expo Center");
        lblExpo.setIcon(new ImageIcon("image/Expo.png"));
        lblExpo.setFont(font);
        lblExpo.setForeground(Color.WHITE);
        pnExpo.add(lblExpo);
        lblExpo.setBounds(40, 20, 150, 50);

        pnExpo.addMouseListener(new java.awt.event.MouseAdapter() {

            @Override
            public void mousePressed(java.awt.event.MouseEvent evt) {
                //Set other pnPanels's image defaul
                imgDefault();
                //Set new image when press
                pnExpo.setOpaque(false);
                pnExpo.setImage(imgPress);
                lblExpo.setForeground(Color.BLACK);
                pnCrossEx.setOpaque(true);
                pnCrossEx.setBackground(Color.WHITE);
                type = 1;

                Content.removeAll();
                pnExpo em = new pnExpo(manager, lblNameOfExpo);
                Content.add(em);
                setVisible(true);
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                if (type != 1) {
                    pnExpo.setOpaque(false);
                    pnExpo.setImage(imgEnter);
                }
            }

            @Override
            public void mouseExited(MouseEvent e) {
                if (type != 1) {
                    pnExpo.setOpaque(false);
                    pnExpo.setImage(imgDef);
                }
            }
        });

        //2
        pnExhibitor = new ImagePanel(imgDef);
        pnExhibitor.setBounds(0, 105, 200, 100);
        pnExhibitor.setLayout(null);

        pnExhibitor.setOpaque(true);
        PanelLeft.add(pnExhibitor);
        lblExhibitor = new JLabel("  Exhibitor");
        lblExhibitor.setFont(font);
        lblExhibitor.setIcon(new ImageIcon("image/exhibitor.png"));
        lblExhibitor.setForeground(Color.WHITE);
        pnExhibitor.add(lblExhibitor);
        lblExhibitor.setBounds(40, 20, 150, 50);

        pnExhibitor.addMouseListener(new java.awt.event.MouseAdapter() {

            @Override
            public void mousePressed(java.awt.event.MouseEvent evt) {
                //Set other pnPanels's image defaul
                imgDefault();
                //Set new image when press
                pnExhibitor.setOpaque(false);
                pnExhibitor.setImage(imgPress);
                lblExhibitor.setForeground(Color.BLACK);
                pnCrossExh.setOpaque(true);
                pnCrossExh.setBackground(Color.WHITE);
                type = 2;

                Content.removeAll();
                pnExhibitor ex = new pnExhibitor();
                Content.add(ex);
                setVisible(true);
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                if (type != 2) {
                    pnExhibitor.setOpaque(false);
                    pnExhibitor.setImage(imgEnter);
                }
            }

            @Override
            public void mouseExited(MouseEvent e) {
                if (type != 2) {
                    pnExhibitor.setOpaque(false);
                    pnExhibitor.setImage(imgDef);
                }
            }
        });
        //3
        pnBooth = new ImagePanel(imgDef);
        pnBooth.setBounds(0, 210, 200, 100);
        pnBooth.setLayout(null);

        pnBooth.setOpaque(true);
        PanelLeft.add(pnBooth);
        lblBooth = new JLabel("  Booth");
        lblBooth.setFont(font);
        lblBooth.setIcon(new ImageIcon("image/booth.png"));
        lblBooth.setForeground(Color.WHITE);
        pnBooth.add(lblBooth);
        lblBooth.setBounds(40, 20, 150, 50);

        pnBooth.addMouseListener(new java.awt.event.MouseAdapter() {

            @Override
            public void mousePressed(java.awt.event.MouseEvent evt) {
                //Set other pnPanels's image defaul
                imgDefault();
                //Set new image when press
                pnBooth.setOpaque(false);
                pnBooth.setImage(imgPress);
                lblBooth.setForeground(Color.BLACK);
                pnCrossBo.setOpaque(true);
                pnCrossBo.setBackground(Color.WHITE);
                type = 3;

                Content.removeAll();
                pnBooth bo = new pnBooth();
                Content.add(bo);
                setVisible(true);
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                if (type != 3) {
                    pnBooth.setOpaque(false);
                    pnBooth.setImage(imgEnter);
                }
            }

            @Override
            public void mouseExited(MouseEvent e) {
                if (type != 3) {
                    pnBooth.setOpaque(false);
                    pnBooth.setImage(imgDef);
                }
            }
        });

        //4
        pnReport = new ImagePanel(imgDef);
        pnReport.setBounds(0, 315, 200, 100);
        pnReport.setLayout(null);

        pnReport.setOpaque(true);
        PanelLeft.add(pnReport);
        lblReport = new JLabel("  Report");
        lblReport.setFont(font);
        lblReport.setIcon(new ImageIcon("image/Report.png"));
        lblReport.setForeground(Color.WHITE);
        pnReport.add(lblReport);
        lblReport.setBounds(40, 20, 150, 50);

        pnReport.addMouseListener(new MouseAdapter() {

            @Override
            public void mousePressed(java.awt.event.MouseEvent evt) {
                //Set other pnPanels's image defaul
                imgDefault();
                //Set new image when press
                pnReport.setOpaque(false);
                pnReport.setImage(imgPress);
                lblReport.setForeground(Color.BLACK);
                pnCrossRe.setOpaque(true);
                pnCrossRe.setBackground(Color.WHITE);
                type = 4;

                Content.removeAll();
                pnReport re = new pnReport();
                Content.add(re);
                setVisible(true);
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                if (type != 4) {
                    pnReport.setOpaque(false);
                    pnReport.setImage(imgEnter);
                }
            }

            @Override
            public void mouseExited(MouseEvent e) {
                if (type != 4) {
                    pnReport.setOpaque(false);
                    pnReport.setImage(imgDef);
                }
            }
        });

        
    }

    public void imgDefault() {
        switch (type) {
            case 1:
                pnExpo.setOpaque(false);
                pnExpo.setImage(imgDef);
                lblExpo.setForeground(Color.WHITE);
                pnCrossEx.setOpaque(false);
                pnCrossEx.setBackground(null);
                break;
            case 2:
                pnExpo.setOpaque(false);
                pnExhibitor.setImage(imgDef);
                lblExhibitor.setForeground(Color.WHITE);
                pnCrossExh.setOpaque(false);
                pnCrossExh.setBackground(null);
                break;
            case 3:
                pnBooth.setOpaque(false);
                pnBooth.setImage(imgDef);
                lblBooth.setForeground(Color.WHITE);
                pnCrossBo.setOpaque(false);
                pnCrossBo.setBackground(null);
                break;
            case 4:
                pnReport.setOpaque(false);
                pnReport.setImage(imgDef);
                lblReport.setForeground(Color.WHITE);
                pnCrossRe.setOpaque(false);
                pnCrossRe.setBackground(null);
                break;
        }
    }

    private void login() {
        DLLogin login = new DLLogin(this, true);
        login.setLocationRelativeTo(this);
        login.setVisible(true);
    }

    public void loadStatistic(){
        Content.removeAll();
        pnStatistics sst = new pnStatistics();
        Content.add(sst);
    }

    public void readNameExpo() {
        try {
            File file = new File("NameOfExpo.txt");
            if (file.exists()) {
                BufferedReader br = new BufferedReader(new FileReader(file));
                String name = br.readLine();
                lblNameOfExpo.setText(name);

                br.close();
            }

        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public void setManager(Manager m) {
        this.manager = m;
        //set name of manager for label
        String name = manager.getName();
        lblNameManager.setText(name);

        if (manager.getPower() == powerAdmin) {
            lblPower.setText("Administrator");
        } else {
            lblPower.setText("Manager");
        }

    }

    public void setBackground(String str) {
        pnBackground.setOpaque(false);
        pnBackground.setImage(str);
    }

    public void openConnection() {
        boolean flag = new OpenConnection().openConnection();
        if (flag == false) {
            //view dialog config. if config true, view dialog login
            JOptionPane.showMessageDialog(this, "Connect database has been error!!");

            DLConfigs cof = new DLConfigs(this, true);
            cof.setVisible(true);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Background = new javax.swing.JPanel();
        Panel = new javax.swing.JPanel();
        PanelLeft = new javax.swing.JPanel();
        Content = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        lblNameManager = new javax.swing.JLabel();
        lblPower = new javax.swing.JLabel();
        lblHelp = new javax.swing.JLabel();
        lblChangeSkin = new javax.swing.JLabel();
        lblNameOfExpo = new javax.swing.JLabel();
        lblConfigs = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Expo Management System");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setUndecorated(true);

        Background.setOpaque(false);
        Background.setPreferredSize(new java.awt.Dimension(830, 585));
        Background.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                BackgroundMouseDragged(evt);
            }
        });
        Background.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                BackgroundMousePressed(evt);
            }
        });

        Panel.setOpaque(false);
        Panel.setPreferredSize(new java.awt.Dimension(810, 450));
        Panel.setLayout(null);

        PanelLeft.setOpaque(false);
        PanelLeft.setPreferredSize(new java.awt.Dimension(200, 450));
        PanelLeft.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                PanelLeftMouseDragged(evt);
            }
        });

        org.jdesktop.layout.GroupLayout PanelLeftLayout = new org.jdesktop.layout.GroupLayout(PanelLeft);
        PanelLeft.setLayout(PanelLeftLayout);
        PanelLeftLayout.setHorizontalGroup(
            PanelLeftLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 200, Short.MAX_VALUE)
        );
        PanelLeftLayout.setVerticalGroup(
            PanelLeftLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 450, Short.MAX_VALUE)
        );

        Panel.add(PanelLeft);
        PanelLeft.setBounds(0, 0, 200, 450);

        Content.setBackground(new java.awt.Color(255, 255, 255));
        Content.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                ContentMouseDragged(evt);
            }
        });
        Content.setLayout(new java.awt.BorderLayout());
        Panel.add(Content);
        Content.setBounds(210, 0, 600, 450);

        jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 18));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("<html>\n<font style=\"font-size:12px\">FPT-Aptech</font><br>\n<font style=\"font-size:18px\">Expo Management System</font><br>\n<font style=\"font-size:12px\">2010</font><br>\n</html>");

        lblNameManager.setFont(new java.awt.Font("Tahoma", 1, 11));
        lblNameManager.setForeground(new java.awt.Color(255, 255, 255));
        lblNameManager.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblNameManager.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Source/users-icon.png"))); // NOI18N
        lblNameManager.setText("nameManager");
        lblNameManager.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                lblNameManagerMousePressed(evt);
            }
        });

        lblPower.setFont(new java.awt.Font("Tahoma", 1, 11));
        lblPower.setForeground(new java.awt.Color(255, 255, 255));
        lblPower.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Source/lightning-icon.png"))); // NOI18N
        lblPower.setText("Power");

        lblHelp.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblHelp.setForeground(new java.awt.Color(255, 255, 255));
        lblHelp.setText("Help");
        lblHelp.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                lblHelpMousePressed(evt);
            }
        });

        lblChangeSkin.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblChangeSkin.setForeground(new java.awt.Color(255, 255, 255));
        lblChangeSkin.setText("Change Skin");
        lblChangeSkin.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                lblChangeSkinMousePressed(evt);
            }
        });

        lblNameOfExpo.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
        lblNameOfExpo.setForeground(new java.awt.Color(255, 255, 255));
        lblNameOfExpo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblNameOfExpo.setText("Expo");

        lblConfigs.setFont(new java.awt.Font("Tahoma", 1, 12));
        lblConfigs.setForeground(new java.awt.Color(255, 255, 255));
        lblConfigs.setText("Configs");
        lblConfigs.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                lblConfigsMousePressed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout BackgroundLayout = new org.jdesktop.layout.GroupLayout(Background);
        Background.setLayout(BackgroundLayout);
        BackgroundLayout.setHorizontalGroup(
            BackgroundLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, BackgroundLayout.createSequentialGroup()
                .addContainerGap(234, Short.MAX_VALUE)
                .add(lblNameOfExpo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 426, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(170, 170, 170))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, BackgroundLayout.createSequentialGroup()
                .add(28, 28, 28)
                .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 363, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 204, Short.MAX_VALUE)
                .add(lblNameManager, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 108, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(lblPower, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 99, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .add(BackgroundLayout.createSequentialGroup()
                .addContainerGap()
                .add(BackgroundLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(BackgroundLayout.createSequentialGroup()
                        .add(10, 10, 10)
                        .add(lblHelp)
                        .add(18, 18, 18)
                        .add(lblChangeSkin)
                        .add(18, 18, 18)
                        .add(lblConfigs))
                    .add(Panel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 810, Short.MAX_VALUE))
                .addContainerGap())
        );
        BackgroundLayout.setVerticalGroup(
            BackgroundLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(BackgroundLayout.createSequentialGroup()
                .add(lblNameOfExpo)
                .add(4, 4, 4)
                .add(BackgroundLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(BackgroundLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(lblPower)
                        .add(lblNameManager, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jLabel1))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(Panel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(BackgroundLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(lblHelp)
                    .add(lblChangeSkin)
                    .add(lblConfigs))
                .add(51, 51, 51))
        );

        getContentPane().add(Background, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BackgroundMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BackgroundMouseDragged
        // Lay toa do diem cu
        Point pOld = getLocation();
        int xOld = pOld.x;
        int yOld = pOld.y;
        //System.out.println("X: "+pOld.x);
        //System.out.println("Y: "+pOld.y);
        //khoang cach giua press va dragg mouse
        int xAdjustment = evt.getX() - x;
        int yAdjustment = evt.getY() - y;
        //Toa do moi = toa do cu + khoang cach
        setLocation(xOld + xAdjustment, yOld + yAdjustment);
    }//GEN-LAST:event_BackgroundMouseDragged

    private void BackgroundMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BackgroundMousePressed
        // TODO add your handling code here:
        x = evt.getX();
        y = evt.getY();


    }//GEN-LAST:event_BackgroundMousePressed

    private void PanelLeftMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_PanelLeftMouseDragged
        // TODO add your handling code here:
    }//GEN-LAST:event_PanelLeftMouseDragged

    private void ContentMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ContentMouseDragged
        // TODO add your handling code here:
    }//GEN-LAST:event_ContentMouseDragged

    private void lblNameManagerMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblNameManagerMousePressed
        // TODO add your handling code here:
       
    }//GEN-LAST:event_lblNameManagerMousePressed

    private void lblHelpMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblHelpMousePressed
        // TODO add your handling code here:
    }//GEN-LAST:event_lblHelpMousePressed

    private void lblChangeSkinMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblChangeSkinMousePressed
        // TODO add your handling code here:
        DLChangeSkin ck = new DLChangeSkin(this, true);
        ck.setVisible(true);
    }//GEN-LAST:event_lblChangeSkinMousePressed

    private void lblConfigsMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblConfigsMousePressed
        // TODO add your handling code here:
        DLConfigs cof = new DLConfigs(this, true);
        cof.setVisible(true);
    }//GEN-LAST:event_lblConfigsMousePressed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                Home home = new Home();
                home.setVisible(true);
                //call dialog login
                home.login();
                //visible statistic
                home.loadStatistic();
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Background;
    private javax.swing.JPanel Content;
    private javax.swing.JPanel Panel;
    private javax.swing.JPanel PanelLeft;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel lblChangeSkin;
    private javax.swing.JLabel lblConfigs;
    private javax.swing.JLabel lblHelp;
    private javax.swing.JLabel lblNameManager;
    private javax.swing.JLabel lblNameOfExpo;
    private javax.swing.JLabel lblPower;
    // End of variables declaration//GEN-END:variables
    private int x, y;
    private static int powerManager = 2;
    private static int powerAdmin = 1;
}
